package server.business.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import server.business.pojo.BloodSize;
import server.business.service.BloodSizeService;
import server.business.utils.Result;

import java.util.List;

/**
 * 血液规格字典操作
 */
@Controller
@RequestMapping("/bloodSize")
public class BloodSizeController {
    @Autowired
    private BloodSizeService bloodSizeService;

    /**
     * 查询血液规格
     */
    @RequestMapping("/normal/queryBloodSize")
    @ResponseBody
    public Result queryBloodSize() {
        bloodSizeService.list();
        Result result = new Result();
        result.setData(bloodSizeService.list());
        return result;
    }

    @RequestMapping("/normal/query")
    @ResponseBody
    public List<BloodSize> queryData() {
        List<BloodSize> list = bloodSizeService.queryData();
        return list;
    }

    /**
     * myq
     * 获取输血量数据字典
     * 
     * @return
     */
    @GetMapping(value = "/normal/getName")
    @ResponseBody
    public List<BloodSize> getName() {
        return bloodSizeService.list();
    }

    @GetMapping(value = "/normal/getName1")
    @ResponseBody
    public server.business.utils.results.lrz.Result getName1() {
        List<BloodSize> bloodSizes = bloodSizeService.list();
        return server.business.utils.results.lrz.Result.success(bloodSizes);
    }

}
